import request from '@/utils/request'

export function getAllPurchasersByPageAndConditions(data) {
  return request({
    url: '/manager/getAllPurchasersByPageAndConditions',
    method: 'get',
    params: data
  })
}

export function getAllPurchasersByPage(data) {
  return request({
    url: '/manager/getAllPurchasersByPage',
    method: 'get',
    params: data
  })
}



export function addPurchaser(data) {
  return request({
    url: '/manager/addPurchaser',
    method: 'post',
    data
  })
}

export function updatePurchaserById(data) {
  return request({
    url: '/manager/updatePurchaserById',
    method: 'put',
    data
  })
}

// 获取当前采购员所属的管理员之外的其他管理员
export function getManagerInfosExceptId(data) {
  return request({
    url: '/manager/getManagerInfosExceptId',
    method: 'get',
    params:data
  })
}

// 修改采购员所属的上级
export function updatePurchaserManager(data) {
  return request({
    url: '/manager/updatePurchaserManager',
    method: 'put',
    params: data
  })
}

export function deletePurchaser(id) {
  return request({
    url: '/manager/deletePurchaser',
    method: 'delete',
    params: id
  })
}


